<template>
    <div>
        
        <van-row style="border-bottom: 1px solid #938b8b">
            <van-cell>
                <van-row style="padding:0 20px">
                    <van-col>
                        <van-image
                            round
                            width="3rem"
                            height="3rem"
                            :src="pinjia.imgsrc"
                        />
                    </van-col>
                    <van-col span= '6' offset="1">
                        <p>{{pinjia.name}}</p>
                        <p>{{pinjia.time}}</p>
                    </van-col>
        
                    <van-col span= '8' offset="4">
                        <span v-for="item in sta" :key="item.id">
                            <van-icon name="star" color="red" size="15" v-if="item" />
                            <van-icon name="star-o" size="15" v-else/>
                        </span>
                    </van-col>
                </van-row>
                <van-row style="padding:0 20px"> 
                    <p>
                        {{pinjia.pinjiatext}}
                    </p>
                    <span>
                        {{pinjia.guige}}
                    </span>
                </van-row>
            </van-cell>
        </van-row>
    </div>
</template>

<script>
export default {
    name:"evaluation",
    data() {
        return {
            sta:[
                false,
                false,
                false,
                false,
                false
            ]
        }
    },
    props:[
        "pinjia"
    ],
    created() {
        switch(this.pinjia.dengji) {
            case 1 : 
                    this.sta = [
                        true,
                        false,
                        false,
                        false,
                        false
                    ];
                    break;
            case 2 : this.sta = [
                        true,
                        true,
                        false,
                        false,
                        false
                    ]; 
                    break;
            case 3 : this.sta = [
                        true,
                        true,
                        true,
                        false,
                        false
                    ];
                    break;
            case 4 : this.sta = [
                        true,
                        true,
                        true,
                        true,
                        false
                        ] 
                    break;
            case 5 : this.sta = [
                        true,
                        true,
                        true,
                        true,
                        true
                        ]
                    break;
        }
        
    },
    methods:{
        dengjis(){
            
        }
    }
    
}
</script>

<style scoped>
    p {
        margin: 0;
    }
    div {
        padding-bottom: 5px;
    }
</style>